package com.cxyzy.demo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;

import com.blankj.utilcode.util.DeviceUtils;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        String mac = MacUtil.getMac(MainActivity.this);
//        mac = DeviceUtils.getMacAddress(); //调用utilcode中函数实现
        TextView textView = findViewById(R.id.textView);
        textView.setText("MAC地址: "+mac);

    }
}
